<template>
	<view>
		<view>
			<u-radio-group v-model="value"  @change="radioGroupChange">
				<view v-for="(item,index) in conpoundList" :key='index' 
				class="u-flex u-padding-40">
					<view>
						<u-radio active-color="#4F8BFF" :name='item.id'></u-radio>
					</view>
					<view class="">
						  <view style="color: #4F8BFF;font-size: 36rpx;font-weight: bold;">{{item.money}}</view>
						  <view style="color: #4F8BFF;font-size: 24rpx;">优惠券（元）</view>
					</view>
					<view class="u-margin-left-20">
						  <view style="font-weight: bold;">无门槛消费券</view>
						  <view class="u-type-info">有效期：{{item.endStr}}</view>
					</view>
				</view>
			</u-radio-group>

		</view>
	</view>
</template>

<script>
	export default {
		props:{
			list:{
				type:Array,
				default:()=>[]
			}
		},
		data() {
			return {
				value: 0,
				conpoundList:this.list
			}
		},
		created() {
			
		},
	
		methods: {
			radioGroupChange(e){
				let objectConpound=this.conpoundList.filter(item=>item.id==e);
					
				if(objectConpound.length){
					this.$emit('selectConpound',objectConpound[0])
				}
				
			}
		}
	}
</script>

<style>
</style>
